<template>
  <div>
    <div class="awearItem-box" v-for="(contentItem, contentIndex) in item.content" :key="contentIndex">
      <!-- 头像 -->
      <div class="title-box">
        <img
          class="img"
          style="height: 32px; width: 32px; border-radius: 20px"
          :src="item.avatar"
        />
        <div class="name">{{ item.expertName }}</div>
        <div class="time">· {{ contentItem.createTime }}</div>
      </div>
      <!-- 回复内容 -->
      <main class="comment-content">
          {{ contentItem.answer }}

        <div  v-for="(lawItem, lawIndex) in contentItem.law" :key="lawIndex">
          <div
            v-if="contentItem.law && contentItem.law.length != 0"
            class="law-box"
          >
            <div class="law-tile">
              {{ lawItem && lawItem.title }}
            </div>

            <div>
              <div class="law-content">
                <div
                  class="content-fen"
                  v-for="(lawContent, index) in lawItem.content"
                  :key="index"
                >
                  {{ lawContent }}
                </div>
              </div>
            </div>
            
          </div>
        </div>
      </main>
      <!-- 附件 -->
      <div class="accessory">
          <ul>
            <!-- <li>{{item.content[0].file}}</li> -->
            <li v-for="(file,index) in contentItem.file" :key="index">
                <a :href="file.url">
                    <span class="el-icon-document"> 附件：{{file.name}}</span>
                    <svg-icon icon-class="download"/>
                </a>
            </li>
          </ul>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    item: {
      type: Object,
      default: () => {
        return {};
      },
    },
  },
  data() {
    return {};
  },
  created() {
    console.log(this.item, "chulai");
  },
  methods: {},
};
</script>

<style lang="scss" scoped>
.awearItem-box {
  margin-top: 40px;
  .title-box {
    display: flex;
    align-items: center;
    .name {
      font-size: 14px;
      font-weight: 800;
      margin: 0 8px 0 10px;
    }
    .time {
      font-size: 12px;
      color: #999;
    }
    margin-bottom: 15px;
  }
  .comment-content {
    font-size: 14px;
    color: #000;
    font-family: PingFangSC-Regular, PingFang SC;
    margin-bottom: 15px;
    > div {
      margin-top: 15px;
    }
  }

  .law-box {
    // font-weight: 800;
    color: #868fa3;
    background-color: #f6f7fa;
    padding: 15px;
    border-radius: 4px;
    margin-top: 15px;
    .law-tile {
      color: #768097;
      font-weight: 700;
    }
    .law-tile::after {
      display: block;
      content: "";
      margin: 5px 0px;
      height: 2px;
      background-color: #f1f3f4;
    }
    .law-content {
      .content-fen {
        // text-indent: 14px;
      }
    }
  }
}
/* 附件 */
.accessory{
    margin-top: 0px;
}
.accessory ul{
    padding: 0;
}
.accessory ul>li{
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    font-size: 12px;
    color: #666;
    border: 1px solid #EFEFEF;
    border-radius: 8px;
}
.accessory ul>li>a{
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.accessory ul>li svg{
    cursor: pointer;
    font-size: 16px;
}

</style>
